﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Blog.Core.Domain.Model.Quartz
{
    /// <summary>
    /// 定时任务
    /// </summary>
    public class QuartzOptions:Audit
    {
        /// <summary>
        /// 定时任务id
        /// </summary>
        [Key]
        public int Id { get; set; }
        /// <summary>
        /// 定时任务名
        /// </summary>
        public string TaskName { get; set; }
        /// <summary>
        /// 任务分组
        /// </summary>
        public string GroupName { get; set; }
        /// <summary>
        /// 请求方式
        /// </summary>
        public string Method { get; set; }
        /// <summary>
        ///超时时间(秒)
        /// </summary>
        [Display(Name = "超时时间(秒)")]
        [Editable(true)]
        public int? TimeOut { get; set; }

        /// <summary>
        ///Corn表达式
        /// </summary>
        [Display(Name = "Corn表达式")]
        [MaxLength(100)]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public string CronExpression { get; set; }

        /// <summary>
        ///Url地址
        /// </summary>
        [Display(Name = "Url地址")]
        [MaxLength(2000)]
        [Editable(true)]
        public string ApiUrl { get; set; }

        /// <summary>
        ///post参数
        /// </summary>
        [Display(Name = "post参数")]
        [Editable(true)]
        public string PostData { get; set; }

        /// <summary>
        ///AuthKey
        /// </summary>
        [Display(Name = "AuthKey")]
        [MaxLength(200)]
        [Editable(true)]
        public string AuthKey { get; set; }

        /// <summary>
        ///AuthValue
        /// </summary>
        [Display(Name = "AuthValue")]
        [MaxLength(200)]
        [Editable(true)]
        public string AuthValue { get; set; }

        /// <summary>
        ///描述
        /// </summary>
        [Display(Name = "描述")]
        [MaxLength(2000)]
        [Editable(true)]
        public string Describe { get; set; }

        /// <summary>
        ///最后执行执行
        /// </summary>
        [Display(Name = "最后执行执行")]
        [Editable(true)]
        public DateTime? LastRunTime { get; set; }

        /// <summary>
        ///运行状态
        /// </summary>
        [Display(Name = "运行状态")]
        [Editable(true)]
        public int? Status { get; set; }
    }
}
